package com.king.micro.common;

import com.zeus.framework.commons.json.Json;
import com.king.micro.common.exception.BusinessException;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 赵晓光
 *         created 2017/11/10 15:29
 *         copyright 2017 micro
 * @FileName: T_SayHello.java
 * package: com.king.micro.common
 */
public class T_SayHello  {

    @Test
    public void sayHello() {

        CglibProxy cglibProxy = new CglibProxy();
        SayHello sayHello = (SayHello)cglibProxy.getProxy(SayHello.class);
        String name = sayHello.say("2");
        System.out.println(name);
    }

    @Test
    public void sayHello_01() {

        BusinessException businessException = new BusinessException("1111");
        System.out.println(Json.toJsonString(businessException.getCode()));
        System.out.println(businessException.getCode());
    }

    @Test
    public void sayHello_02() {
        BusinessException businessException = new BusinessException("1111");
        System.out.println(Json.toJsonString(businessException.getCode()));
        System.out.println(businessException.getCode());
    }

    @Test
    public void sayHello_05() throws Exception{
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                new String[]{"/META-INF/spring/applicationContext-common.xml"});
        context.start();

        System.out.println("提供者正在Press any key to exit.");
        System.in.read();
    }


}
